package com.apollow.oschina.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.apollow.oschina.R;
import com.apollow.oschina.base.BaseFragment;
import com.apollow.oschina.base.Global;
import com.apollow.oschina.ui.ActiveActivity;
import com.apollow.oschina.ui.FriendsActivity;
import com.apollow.oschina.ui.ShakeActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by bobo on 2017/1/12.
 */

public class DiscoverFragment extends BaseFragment {
    @BindView(R.id.ll_friend)
    LinearLayout mLlFriend;
    @BindView(R.id.ll_finduser)
    LinearLayout mLlFinduser;
    @BindView(R.id.ll_event)
    LinearLayout mLlEvent;
    @BindView(R.id.ll_scan)
    LinearLayout mLlScan;
    @BindView(R.id.ll_shake)
    LinearLayout mLlShake;

    private Context mContext;

    @Nullable

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = View.inflate(getContext(), R.layout.fragment_discover, null);
        ButterKnife.bind(this, view);
        return view;
    }

    @OnClick({R.id.ll_friend, R.id.ll_finduser, R.id.ll_event, R.id.ll_scan, R.id.ll_shake})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ll_friend:
                Global.showToast("好友圈");
                Intent friendsIntent = new Intent(getActivity(),FriendsActivity.class);
                startActivity(friendsIntent);
                break;
            case R.id.ll_finduser:
                Global.showToast("找人");
                break;
            case R.id.ll_event:
                Global.showToast("活动");
                Intent activeIntent = new Intent(getActivity(),ActiveActivity.class);
                startActivity(activeIntent);
                break;
            case R.id.ll_scan:
                Global.showToast("扫一扫");
                //Intent scanIntent = new Intent(getActivity(),ScanActivity.class);
                //startActivity(scanIntent);
                break;
            case R.id.ll_shake:
//                Global.showToast("摇一摇");
                Intent intent = new Intent(getActivity(),ShakeActivity.class);
                startActivity(intent);
                break;
        }
    }
}
